<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">

        <ui:define name="title">
            <h:outputText value="#{bundle.ListDemandaHabitacionalTitle}"></h:outputText>
        </ui:define>

        <ui:define name="body">
            <h:form id="DemandaHabitacionalListForm">
                <p:panel id="panel" header="#{bundle.ListDemandaHabitacionalTitle}">
                    <p:dataTable id="datalist" value="#{demandaHabitacionalController.items}" var="item"
                                 selectionMode="single" selection="#{demandaHabitacionalController.selected}"
                                 paginator="true"
                                 rowKey="#{item.id}"
                                 rows="10"
                                 rowsPerPageTemplate="10,20,30,40,50"
                                 >

                        <p:ajax event="rowSelect"   update="createButton viewButton editButton deleteButton"/>
                        <p:ajax event="rowUnselect" update="createButton viewButton editButton deleteButton"/>
                        
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListDemandaHabitacionalTitle_fcarga}"/>
                            </f:facet>
                            <h:outputText value="#{item.fcarga}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListDemandaHabitacionalTitle_responsable}"/>
                            </f:facet>
                            <h:outputText value="#{item.nombreDelSolicitante}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListDemandaHabitacionalTitle_tresponsable}"/>
                            </f:facet>
                            <h:outputText value="#{item.telefonoDelSolicitante}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>

                        <f:facet name="footer">
                            <p:commandButton id="createButton" icon="ui-icon-plus"   value="#{bundle.Create}" actionListener="#{demandaHabitacionalController.prepareCreate}" update=":DemandaHabitacionalCreateForm" oncomplete="PF('demandaHabitacionalCreateDialog').show()"/>
                            <p:commandButton id="viewButton"   icon="ui-icon-search" value="#{bundle.View}" actionListener="#{demandaHabitacionalController.modoVista}"  update=":DemandaHabitacionalViewForm" oncomplete="PF('DemandaHabitacionalViewDialog').show()" disabled="#{empty demandaHabitacionalController.selected}"/>
                            <p:commandButton id="editButton" disabled="true"  icon="ui-icon-pencil" value="#{bundle.Edit}" update=":DemandaHabitacionalEditForm" oncomplete="PF('demandaHabitacionalEditDialog').show()" />
                            <p:commandButton id="deleteButton" icon="ui-icon-trash"  value="#{bundle.Delete}" actionListener="#{demandaHabitacionalController.destroy}" update=":growl,datalist" disabled="#{empty demandaHabitacionalController.selected}"/>
                            
<!--                            <p:commandButton id="pruebaButton" icon="ui-icon-trash"  value="prueba" action="#{demandaHabitacionalController.prueba}" actionListener="#{demandaHabitacionalController.listener}" >
                                <f:attribute name="grupoFamiliar" value="#{demandaHabitacionalController.selected.grupoFamiliar}"></f:attribute>        
                            </p:commandButton>    -->
                        </f:facet>
                    </p:dataTable>
                     <p:growl id="growl" sticky="true" showDetail="true"/>
   
                </p:panel>
                
            </h:form>

            <ui:include src="Create.xhtml"/>
            <ui:include src="Edit.xhtml"/>
            <ui:include src="View.xhtml"/>
        </ui:define>
    </ui:composition>

</html>

<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:tnt="http://java.sun.com/jsf/composite/sstuv">
         
         
   <h:head>
       <title>Composite component example...</title>
   </h:head>
 
   <h:body>
     <h:form>
         <tnt:personasCrudComposite />
     </h:form>            
   </h:body>
    
</html>-->
